
/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光 
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.DataAccess.Utilities
*        文件名:             IDbHelper.cs
*        创建系统时间:       2012/11/2 19:07:01
*        创建年份:           2012
*
/*****************************************************************************/
namespace ECP.DataAccess.Utilities
{
    using System;
    using System.Data;
    using System.Data.Common;

    public interface IDbHelper
    {
        void AttachAdapterParameters(IDataParameter[] commandParameters);
        void AttachParameters(IDbCommand TargetDbCommand, IDataParameter[] commandParameters);
        IDbTransaction BeginTransaction();
        void Close();
        void CommitTransaction();
        int ExecuteNonQuery(string sqlQuery);
        int ExecuteNonQuery(string sqlQuery, DbParameter[] dbParameters);
        int ExecuteNonQuery(CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        int ExecuteNonQuery(IDbTransaction DbTransaction, CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        int ExecuteProcedure(string procedureName);
        int ExecuteProcedure(string procedureName, DbParameter[] dbParameters);
        DataTable ExecuteProcedureForDataTable(string procedureName, string tableName, DbParameter[] dbParameters);
        IDataReader ExecuteReader(string sqlQuery);
        IDataReader ExecuteReader(string sqlQuery, DbParameter[] dbParameters);
        IDataReader ExecuteReader(CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        object ExecuteScalar(string sqlQuery);
        object ExecuteScalar(string sqlQuery, DbParameter[] dbParameters);
        object ExecuteScalar(CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        object ExecuteScalar(IDbTransaction DbTransaction, CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        DataTable Fill(DataTable dataTable, string sqlQuery);
        DataSet Fill(DataSet dataSet, string sqlQuery, string tableName);
        DataTable Fill(DataTable dataTable, string sqlQuery, DbParameter[] dbParameters);
        DataSet Fill(DataSet dataSet, string sqlQuery, string tableName, DbParameter[] dbParameters);
        DataTable Fill(DataTable dataTable, CommandType CommandType, string sqlQuery, DbParameter[] dbParameters);
        DataSet Fill(DataSet dataSet, CommandType CommandType, string sqlQuery, string tableName, DbParameter[] dbParameters);
        IDbCommand GetDbCommand();
        IDbConnection GetDbConnection();
        string GetDBDateTime();
        string GetDBNow();
        IDbTransaction GetDbTransaction();
        string GetParameter(string parameter);
        DbProviderFactory Instance();
        DbParameter MakeInParam(string targetFiled, object targetValue);
        DbParameter MakeParam(string paramName, DbType dbType, int size, ParameterDirection direction, object value);
        DbParameter[] MakeParameters(string[] targetFileds, object[] targetValues);
        DbParameter[] MakeParameters(string targetFiled, object targetValue);
        IDbConnection Open();
        IDbConnection Open(string connectionString);
        string PlusSign(params string[] values);
        void RollbackTransaction();
        string SqlSafe(string value);
        void WriteLog(string sqlQuery);

        bool InTransaction { get; set; }
    }
}


